import { http } from '@/utils/https'
import { Result, Category, PageParams, PageResult, GuessItem } from '@/types/home.d.ts'

export const getHomeBanner = (distributionSite: 1) => {
  return http<Result[]>({
    url: '/home/banner',
    method: 'GET',
    data: {
      distributionSite,
    },
  })
}

export const getHomeCategory = () => {
  return http<Category[]>({
    url: '/home/category/mutli',
    method: 'GET',
  })
}

export const getHomeHost = () => {
  return http({
    url: '/home/hot/mutli',
    method: 'GET',
  })
}

export const getHomeGoodsGuessLikeAPI = (data?: PageParams) => {
  return http<PageResult<GuessItem>>({
    method: 'GET',
    url: '/home/goods/guessLike',
    data,
  })
}

export const getHotRecommendAPI = (url: string, data?: any) => {
  return http({
    method: 'GET',
    url,
    data,
  })
}
